package com.digua.base.socket.request

import org.java_websocket.client.WebSocketClient


class ByteArrayRequest : Request<ByteArray> {
    private var data: ByteArray? = null

    override fun setRequestData(data: ByteArray) {
        this.data = data
    }

    override fun getRequestData(): ByteArray? = data

    override fun send(client: WebSocketClient?) {
        client?.send(data)
    }

    override fun release() {
        RequestFactory.releaseByteArrayRequest(this)
    }

    override fun toString() = "[@ByteArrayRequest${hashCode()},${data?.let { "data.length:" + it.size } ?: "data:null"}]"
}